package com.cesgroup.zw.spring.boot.library.echarts.pie.simple;

import com.cesgroup.zw.spring.boot.echarts.build.EChartsOption;
import com.cesgroup.zw.spring.boot.echarts.component.Legend;
import com.cesgroup.zw.spring.boot.echarts.component.Title;
import com.cesgroup.zw.spring.boot.echarts.component.Tooltip;
import com.cesgroup.zw.spring.boot.echarts.enums.Align;
import com.cesgroup.zw.spring.boot.echarts.enums.Trigger;

/**
 * <p>描述: 简单饼图</p>
 * @author ytj
 * @date 2019/7/1 11:17
 */
@SuppressWarnings("serial")
public class SimplePieOption extends EChartsOption{

    public SimplePieOption(SimplePieParam simplePieParam){
        this.setTitle(new Title(){{
            this.setText(simplePieParam.getTitle());
            this.setLeft(Align.center);
        }});
        this.setTooltip(new Tooltip(){{
            this.setTrigger(Trigger.item);
        }});
        this.setLegend(new Legend(){{
            this.setBottom(10);
            this.setLeft(Align.center);
        }});
    }

}
